﻿Public Class frmTKBTheoLop
    Sub Hien_thi_lop()
        Dim dt As New DataTable
        dt = LopDAO.SelectAll()
        cmbLop.DataSource = dt
        cmbLop.DisplayMember = "TenLop"
    End Sub

    Private Sub frmTKBTheoLop_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Hien_thi_lop()
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub

    Private Sub btnNhaplai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNhaplai.Click
        cmbLop.Text = ""
        dgvThoiKhoaBieu.Columns.Clear()
    End Sub

    Private Sub btnTraCuu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTraCuu.Click
        Dim tkb As ThoiKhoaBieuDTO = New ThoiKhoaBieuDTO()
        tkb.TenLop = cmbLop.Text
        dgvThoiKhoaBieu.DataSource = ThoiKhoaBieuDAO.TKBTheoLop(tkb)
        If dgvThoiKhoaBieu.SelectedRows.Count < 1 Then
            MsgBox("Không có thông tin !")
        End If
    End Sub
End Class